﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_IPORT.Master"
    CodeBehind="frmFollow_Payin.aspx.vb" Inherits="I_PORT.frmFollow_Payin" title="IRPC INTELLIGENT PORT SERVICE" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script type="text/javascript" language="javascript">
        function closeModal(type) {
           // document.getElementById('ctl00_contentplaceholder1_framePopup').src = 'about:blank';
            if (type == 'X')
            {
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender7');
            document.getElementById('ctl00_contentplaceholder1_btnLoadPayin').click();
            mpu.hide();
            }
            else if(type == 'C'){
              document.getElementById('ctl00_contentplaceholder1_iframeCustomer').src = '../FormPopup/frmFollow_Payin.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender1');
            document.getElementById('ctl00_contentplaceholder1_btnCusLoad').click();
            mpu.hide();
            
            }
        }
    </script>

    <asp:UpdatePanel ID="UpdatePanelOnlinePayment" runat="server">
        <ContentTemplate>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td style="height: 5px;">
                        <img src="../Image/space.gif" />
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <asp:TabContainer ID="TabPayment" runat="server" Width="100%" AutoPostBack="true"
                            ActiveTabIndex="0">
                            <asp:TabPanel ID="TabAdvanced" runat="server" HeaderText="Advanced Payment">
                                <ContentTemplate>
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td align="center">
                                                <fieldset style="width: 95%">
                                                    <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                        ค้นหา</legend>
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                        <tr>
                                                            <td style="width: 20%;" align="right">
                                                                <asp:Label ID="lbBank" runat="server" Text="ชื่อ/รหัสลูกค้า :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtCustomer" runat="server"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="width: 20%;" align="right">
                                                                &nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:Button ID="btnSearch" runat="server" CssClass="ButtonStyle" Text="ค้นหา" />
                                                                 <asp:Button ID="btnClear" runat="server" CssClass="ButtonStyle" Text="เคลียร์" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </fieldset>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height: 5px;">
                                                <img src="../Image/space.gif" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center">
                                                <fieldset style="width: 95%">
                                                    <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                        รายการค้างชำระ</legend>
                                                    <asp:GridView ID="gridpayment" runat="server" SkinID="gridblue" DataKeyNames="Owner_Product,Booking_no,Customer_Name"
                                                        AutoGenerateColumns="False">
                                                        <PagerTemplate>
                                                            <table>
                                                                <tr>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgFirst" runat="server" CommandArgument="First" 
                                                                            CommandName="Page" Height="22px" ImageUrl="../Image/arrow-first.gif" 
                                                                            OnCommand="Paginate" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgBack" runat="server" Height="22px" ImageUrl="../Image/arrow-back.gif"
                                                                            OnCommand="Paginate" CommandArgument="Prev" CommandName="Page" />
                                                                    </td>
                                                                    <td valign="top">
                                                                        Page
                                                                        <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true" 
                                                                            OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                                        </asp:DropDownList>
                                                                        of
                                                                        <asp:Label ID="lbPageCount" runat="server" Text="Label"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgNext" runat="server" Height="22px" ImageUrl="../Image/arrow-next.gif"
                                                                            OnCommand="Paginate" CommandArgument="Next" CommandName="Page" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgEnd" runat="server" Height="22px" ImageUrl="../Image/arrow-end.gif"
                                                                            OnCommand="Paginate" CommandArgument="Last" CommandName="Page" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </PagerTemplate>
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="Select">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="LinkBooking" runat="server" Text="ชำระค่าบริการ" CommandArgument="<%# Container.DataItemIndex %>"
                                                                        CommandName="Edit" ></asp:LinkButton>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:BoundField HeaderText="Customer" DataField="Customer_Name" />
                                                            <asp:BoundField HeaderText="Type" DataField="TypePay" />
                                                            <asp:BoundField HeaderText="NET AMOUNT" />
                                                            <asp:BoundField HeaderText="Booking No." DataField="Booking_no" />
                                                            <asp:BoundField HeaderText="Vessel" DataField="Vehicle_Text" />
                                                        </Columns>
                                                    </asp:GridView>
                                                    <asp:Label ID="lbAlert" runat="server" Font-Names="Tahoma" Style="color: Red; font-size: 16px;"
                                                        Visible="False"></asp:Label>
                                                </fieldset>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:TabPanel>
                            <asp:TabPanel ID="TabCNDN" runat="server" HeaderText="CN/DN">
                                <ContentTemplate>
                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                        <tr>
                                            <td align="center">
                                                <fieldset style="width: 95%">
                                                    <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                        ค้นหา</legend>
                                                    <table width="95%" border="0" cellpadding="0" cellspacing="0">
                                                        <tr><td style="height: 5px;"><img src="../Image/space.gif" /></td></tr>
                                                        <tr>
                                                            <td style="width: 20%;" align="right">
                                                                <asp:Label ID="Label7" runat="server" Text="ลูกค้า :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtCustomerCNDN" runat="server" Width="150px" ></asp:TextBox>&nbsp;<asp:Button ID="BtnSearchCNDN" runat="server" Text="ค้นหา" CssClass="ButtonStyle" />
                                                            </td>
                                                        </tr>
                                                        <tr><td style="height: 5px;"><img src="../Image/space.gif" /></td></tr>
                                                    </table>
                                                </fieldset>
                                            </td>
                                        </tr>
                                        <tr><td style="height: 5px;"><img src="../Image/space.gif" /></td></tr>
                                        <tr>
                                           <td>
                                              <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                 <tr>
                                                    <td colspan="2"  align="left">&nbsp;<asp:Label ID="lbName" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                                 </tr>
                                                 <tr>
                                                    <tdalign="left">&nbsp;<asp:Label ID="Label8" runat="server" SkinID="lbtxt" Text="รายการยอดหนี้คงค้างทั้งหมด" ></asp:Label>&nbsp;</td>
                                                 </tr>
                                              </table>
                                           </td>
                                        </tr>
                                        <tr><td style="height: 5px;"><img src="../Image/space.gif" /></td></tr>
                                        <tr>
                                            <td align="center">
                                                <fieldset style="width: 95%">
                                                    <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                        Vat & Non-Vat</legend>
                                                    <table width="95%" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td style="height: 5px;">
                                                                <img src="../Image/space.gif" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                            <asp:Panel ID="PanelCNDN" runat="server" Width="780px" ScrollBars="Horizontal">
                                                                <asp:GridView ID="gridCNDN" runat="server" ShowFooter="true" SkinID="gridblueNoPage" DataKeyNames="BUKRS,BELNR,GJAHR,BUZEI,BILL_TO,MWSKZ,BLART,DOC_DESC,XBLNR,ALLOC_NMBR,BLDAT,DUEDT,WAERS,BASMAT,VAT,NETAMT,WHTAMT,TEXT40,REBZG,REBZJ,REBZZ,Booking_no,Ship_Name"
                                                                    AutoGenerateColumns="False">
                                                                    <Columns>
                                                                        <asp:TemplateField HeaderText="Select">
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox ID="chkCNDN" runat="server" AutoPostBack="true" OnCheckedChanged="chkCNDN_CheckedChanged" /></ItemTemplate>
                                                                            <ItemStyle Width="50px" />
                                                                        </asp:TemplateField>
                                                                        <asp:BoundField HeaderText="ประเภทเอกสาร" DataField="TYPE_DOC" >
                                                                            <ItemStyle HorizontalAlign="Left" Wrap="False" />
                                                                        </asp:BoundField>
                                                                        <asp:BoundField HeaderText="เอกสารอ้างอิง" DataField="ALLOC_NMBR" ItemStyle-Wrap="false" />
                                                                        <asp:BoundField HeaderText="BILL TO" DataField="BILL_TO" />
                                                                        <asp:BoundField HeaderText="วันที่เอกสาร" DataField="BLDAT" />
                                                                        <asp:BoundField HeaderText="วันที่กำหนดชำระ" DataField="DUEDT" />
                                                                        <asp:BoundField HeaderText="สกุลเงิน" DataField="WAERS" />
                                                                        <asp:BoundField HeaderText="จำนวนเงิน" DataField="BASMAT" />
                                                                        <asp:BoundField HeaderText="ภาษีมูลค่าเพิ่ม" DataField="VAT" />
                                                                        <asp:BoundField HeaderText="ยอดคงค้างสุทธิ" />
                                                                        <asp:BoundField HeaderText="ภาษีหัก ณ ที่จ่าย" DataField="WHTAMT" />
                                                                        <asp:BoundField HeaderText="ประเภทภาษีหัก ณ ที่จ่าย" DataField="TEXT40" />
                                                                        <asp:BoundField HeaderText="สถานะ" ItemStyle-Wrap="false"  />
                                                                        <asp:BoundField HeaderText="จำนวนวันที่เกินกำหนด" />
                                                                    </Columns>
                                                                </asp:GridView>
                                                              </asp:Panel>
                                                                <asp:Label ID="lbAlertVat" runat="server" Font-Names="Tahoma" Style="color: Red;
                                                                    font-size: 16px;" Visible="False"></asp:Label>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="height: 5px;">
                                                                <img src="../Image/space.gif" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="left">
                                                                <asp:Panel ID="PanelPayOX" runat="server">
                                                                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="Label9" runat="server" Text="จำนวนเงินสุทธิ :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                           <asp:Label ID="lbMoneyCNDN" runat="server" Text="" SkinID="lbtxt"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="Label1" runat="server" Text="ชำระเงินโดย :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:RadioButtonList ID="radioPay" AutoPostBack="True" SkinID="raio" RepeatDirection="Horizontal"
                                                                                runat="server">
                                                                                <asp:ListItem Value="CH">เช็ค</asp:ListItem>
                                                                                <asp:ListItem Value="TR">โอน</asp:ListItem>
                                                                            </asp:RadioButtonList>
                                                                        </td>
                                                                    </tr>
                                                                    <tr id="rowCH" runat="server" visible="False">
                                                                        <td style="width: 20%;" align="right" runat="server">
                                                                            &nbsp;
                                                                        </td>
                                                                        <td align="left" runat="server">
                                                                            <asp:TextBox ID="txtCH" runat="server" Width="250px"></asp:TextBox>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="lbPayment" runat="server" Text="ธนาคาร :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:DropDownList ID="ddlBankOX" AutoPostBack="True" runat="server">
                                                                                <asp:ListItem Value="0"><--กรุณาเลือกธนาคาร--></asp:ListItem>
                                                                                <asp:ListItem Value="KBANK">ธนาคารกสิกรไทย</asp:ListItem>
                                                                                <asp:ListItem>ธนาคาร</asp:ListItem>
                                                                            </asp:DropDownList>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="Label2" runat="server" Text="เข้าบัญชีธนาคาร :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:DropDownList ID="ddlGL_Account" SkinID="ddl" runat="server">
                                                                            </asp:DropDownList>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="Label3" runat="server" Text="วันที่ชำระเงิน :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:TextBox ID="txtDate" runat="server" Width="80px" onkeypress="return false;"></asp:TextBox>&nbsp;<asp:ImageButton
                                                                                ID="ImgDate" runat="server" ImageUrl="~/Image/calendar.png" />
                                                                            <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate"
                                                                                Format="dd MMM yyyy" PopupButtonID="ImgDate" Enabled="True">
                                                                            </asp:CalendarExtender>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            &nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:Button ID="btnPayOX" runat="server" CssClass="ButtonStyle" Text="ยืนยันการชำระเงินของลูกค้า"
                                                                                Width="180px" />
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                                </asp:Panel>
                                                                <asp:Panel ID="PanelRVOX" runat="server" Visible="false">
                                                                   <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right" valign="top">
                                                                            <asp:Label ID="Label11" runat="server" Text="RV No. :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                           <asp:Label ID="lbRV" runat="server" Text="" SkinID="lbtxt"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            &nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                           <asp:Button ID="btnBackRVOX" runat="server" Text="กลับ" CssClass="ButtonStyle" />
                                                                        </td>
                                                                    </tr>
                                                                </asp:Panel>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="height: 5px;">
                                                                <img src="../Image/space.gif" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </fieldset>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height: 5px;">
                                                <img src="../Image/space.gif" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center">
                                                <fieldset style="width: 95%">
                                                    <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                        Deferred Vat</legend>
                                                    <table width="90%" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td style="height: 5px;">
                                                                <img src="../Image/space.gif" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="center">
                                                              <asp:Panel ID="PanelDefferred" runat="server" Width="780px" ScrollBars="Horizontal">
                                                                <asp:GridView ID="gridDefferred" runat="server" ShowFooter="true" SkinID="gridblueNoPage" DataKeyNames="BUKRS,BELNR,GJAHR,BUZEI,BILL_TO,MWSKZ,BLART,DOC_DESC,XBLNR,ALLOC_NMBR,BLDAT,DUEDT,WAERS,BASMAT,VAT,NETAMT,WHTAMT,TEXT40,REBZG,REBZJ,REBZZ,Booking_no,Ship_Name"
                                                                    AutoGenerateColumns="False">
                                                                    <Columns>
                                                                        <asp:TemplateField HeaderText="Select">
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox ID="chkCNDN" runat="server" AutoPostBack="true" OnCheckedChanged="chkDefferred_CheckedChanged"  /></ItemTemplate>
                                                                            <ItemStyle Width="50px" />
                                                                        </asp:TemplateField>
                                                                        <asp:BoundField HeaderText="ประเภทเอกสาร" DataField="TYPE_DOC" >
                                                                            <ItemStyle HorizontalAlign="Left" Wrap="False" />
                                                                        </asp:BoundField>
                                                                        <asp:BoundField HeaderText="เอกสารอ้างอิง" DataField="ALLOC_NMBR" />
                                                                        <asp:BoundField HeaderText="BILL TO" DataField="BILL_TO" />
                                                                        <asp:BoundField HeaderText="วันที่เอกสาร" DataField="BLDAT" />
                                                                        <asp:BoundField HeaderText="วันที่กำหนดชำระ" DataField="DUEDT" />
                                                                        <asp:BoundField HeaderText="สกุลเงิน" DataField="WAERS" />
                                                                        <asp:BoundField HeaderText="จำนวนเงิน" DataField="BASMAT" />
                                                                        <asp:BoundField HeaderText="ภาษีมูลค่าเพิ่ม" DataField="VAT" />
                                                                        <asp:BoundField HeaderText="ยอดคงค้างสุทธิ" />
                                                                        <asp:BoundField HeaderText="ภาษีหัก ณ ที่จ่าย" DataField="WHTAMT" />
                                                                        <asp:BoundField HeaderText="ประเภทภาษีหัก ณ ที่จ่าย" DataField="TEXT40" />
                                                                        <asp:BoundField HeaderText="สถานะ" ItemStyle-Wrap="false"  />
                                                                        <asp:BoundField HeaderText="จำนวนวันที่เกินกำหนด" />
                                                                    </Columns>
                                                                </asp:GridView>
                                                                </asp:Panel>
                                                                <asp:Label ID="lbAlertDeferred" runat="server" Font-Names="Tahoma" Style="color: Red;
                                                                    font-size: 16px;" Visible="False"></asp:Label>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="height: 5px;">
                                                                <img src="../Image/space.gif" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="left">
                                                                <asp:Panel ID="PanelPayDS" runat="server">
                                                                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="Label10" runat="server" Text="จำนวนเงินสุทธิ :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                           <asp:Label ID="lbMoneyDeferred" runat="server" Text="" SkinID="lbtxt"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="Label4" runat="server" Text="ชำระเงินโดย :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:RadioButtonList ID="radioPayDS" AutoPostBack="True" SkinID="raio" RepeatDirection="Horizontal"
                                                                                runat="server">
                                                                                <asp:ListItem Value="CH">เช็ค</asp:ListItem>
                                                                                <asp:ListItem Value="TR">โอน</asp:ListItem>
                                                                            </asp:RadioButtonList>
                                                                        </td>
                                                                    </tr>
                                                                    <tr id="rowDS" runat="server" visible="False">
                                                                        <td style="width: 20%;" align="right" runat="server">
                                                                            &nbsp;
                                                                        </td>
                                                                        <td align="left" runat="server">
                                                                            <asp:TextBox ID="txtDS" runat="server" Width="250px"></asp:TextBox>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="lbPayment2" runat="server" Text="ธนาคาร:" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:DropDownList ID="ddlBankDS" AutoPostBack="True" runat="server">
                                                                                <asp:ListItem Value="0"><--กรุณาเลือกธนาคาร--></asp:ListItem>
                                                                                <asp:ListItem Value="KBANK">ธนาคารกสิกรไทย</asp:ListItem>
                                                                                <asp:ListItem>ธนาคาร</asp:ListItem>
                                                                            </asp:DropDownList>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="Label5" runat="server" Text="เข้าบัญชีธนาคาร :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:DropDownList ID="ddlGL_AccountDS" SkinID="ddl" runat="server">
                                                                            </asp:DropDownList>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            <asp:Label ID="Label6" runat="server" Text="วันที่ชำระเงิน :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:TextBox ID="txtDateDS" runat="server" Width="80px" onkeypress="return false;"></asp:TextBox>&nbsp;<asp:ImageButton
                                                                                ID="imgDateDS" runat="server" ImageUrl="~/Image/calendar.png" />
                                                                            <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtDateDS"
                                                                                Format="dd MMM yyyy" PopupButtonID="ImgDateDS" Enabled="True">
                                                                            </asp:CalendarExtender>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            &nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                            <asp:Button ID="btnPayDS" runat="server" CssClass="ButtonStyle" Text="ยืนยันการชำระเงินของลูกค้า" />
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                                </asp:Panel>
                                                                <asp:Panel ID="PanelRVDS" runat="server" Visible="false">
                                                                   <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right" valign="top">
                                                                            <asp:Label ID="Label12" runat="server" Text="RV No. :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                           <asp:Label ID="lbRVDS" runat="server" Text="" SkinID="lbtxt"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 20%;" align="right">
                                                                            &nbsp;
                                                                        </td>
                                                                        <td align="left">
                                                                           <asp:Button ID="btnBackRVDS" runat="server" Text="กลับ" CssClass="ButtonStyle" />
                                                                        </td>
                                                                    </tr>
                                                                </asp:Panel>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="height: 5px;">
                                                                <img src="../Image/space.gif" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </fieldset>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:TabPanel>
                           <asp:TabPanel ID="TabRecord" runat="server" HeaderText="Payment Record">
                           <ContentTemplate>
                           <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                                   <tr>
                                            <td align="center">
                                                <fieldset style="width: 95%">
                                                    <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                        ค้นหา</legend>
                                                    <table width="95%" border="0" cellpadding="0" cellspacing="0">
                                                        <tr><td style="height: 5px;"><img src="../Image/space.gif" /></td></tr>
                                                        <tr>
                                                            <td style="width: 20%;" align="right">
                                                                <asp:Label ID="Label13" runat="server" Text="ลูกค้า :" SkinID="lbtxt"></asp:Label>&nbsp;
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtCustomerRecord" runat="server" Width="150px" ></asp:TextBox>&nbsp;<asp:Button ID="btnRecord" runat="server" Text="ค้นหา" CssClass="ButtonStyle" />
                                                            </td>
                                                        </tr>
                                                        <tr><td style="height: 5px;"><img src="../Image/space.gif" /></td></tr>
                                                    </table>
                                                </fieldset>
                                            </td>
                                        </tr>
                               <tr>
                                  <td align="center">
                                  <fieldset style="width:95%"><legend style="color:#848585; font-family:Tahoma;font-size:14px;font-weight:bold;">Payment Record</legend>
                                        <table width="95%" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                        <td style="height:5px;"><img src="../Image/space.gif" /></td>
                                        </tr>
                                        <tr>
                                           <td>
                                           <asp:GridView ID="gridRecord" runat="server" SkinID="gridblueNoPage" DataKeyNames="BUKRS,BELNR,GJAHR,BUZEI,BILL_TO,MWSKZ,BLART,DOC_DESC,XBLNR,BLDAT,DUEDT,WAERS,BASMAT,VAT,NETAMT,WHTAMT,TEXT40,CLEAR_DATE,CLR_DOC_NO,ADV_YEAR,ADV_DOC_NO"
                                        AutoGenerateColumns="False">
                                                                    <Columns>
                                                                        <asp:BoundField HeaderText="เอกสารอ้างอิง" DataField="ALLOC_NMBR" />
                                                                        <asp:BoundField HeaderText="BILL TO" DataField="BILL_TO" />
                                                                        <asp:BoundField HeaderText="วันที่เอกสาร" DataField="BLDAT" />
                                                                        <asp:BoundField HeaderText="วันที่กำหนดชำระ" DataField="DUEDT" />
                                                                        <asp:BoundField HeaderText="วันที่ชำระ" DataField="CLEAR_DATE" />
                                                                        <asp:BoundField HeaderText="สกุลเงิน" DataField="WAERS" />
                                                                        <asp:BoundField HeaderText="จำนวนเงิน" DataField="BASMAT" />
                                                                        <asp:BoundField HeaderText="ภาษีมูลค่าเพิ่ม" DataField="VAT" />
                                                                        <asp:BoundField HeaderText="ยอดคงค้างสุทธิ" />
                                                                        <asp:BoundField HeaderText="ภาษีหัก ณ ที่จ่าย" DataField="WHTAMT" />
                                                                        <asp:BoundField HeaderText="จำนวนเงินสุทธิ" DataField="NETAMT" />
                                                                        <asp:BoundField HeaderText="ประเภทภาษีหัก ณ ที่จ่าย" DataField="TEXT40" />
                                                                    </Columns>
                                                                </asp:GridView>
                                           <asp:Label ID="LabelAlertRecord" runat="server" Font-Names="Tahoma"  style="color:Red; font-size:16px;" Visible="False"></asp:Label></td></tr><tr><td style="height:5px;"><img src="../Image/space.gif" /></td></tr></table></fieldset> </td></tr><tr><td style="height:5px;"><img src="../Image/space.gif" /></td></tr></table></ContentTemplate></asp:TabPanel>
                        </asp:TabContainer>
                    </td>
                </tr>
                <tr>
                    <td style="height: 5px;">
                        <img src="../Image/space.gif" />
                    </td>
                </tr>
            </table>
            <asp:Button ID="btnPayinTemp" runat="server" Text="Button" Style="display: none" />
            <asp:Button ID="btnLoadPayin" runat="server" Text="Button" Style="display: none" />
            <asp:Button ID="btnCustomerTemp" runat="server"  Text="Button" Style="display: none" />
            <asp:Button ID="btnCusLoad" runat="server"  Text="Button" Style="display: none" />
            <asp:ModalPopupExtender ID="ModalPopupExtender7" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnPayinTemp" PopupControlID="PanelPayin">
            </asp:ModalPopupExtender>
             <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="Background"
                TargetControlID="btnCustomerTemp" PopupControlID="PanelCustomer">
            </asp:ModalPopupExtender>
            <asp:Panel ID="PanelPayin" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="iframePayin" marginheight="0px" class="Style-Iframe" marginwidth="0px"></iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="PanelCustomer" runat="server" Style="display: none;">
                <table>
                    <tr>
                        <td>
                            <iframe runat="server" id="iframeCustomer" marginheight="0px" class="Style-Iframe" marginwidth="0px"></iframe>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
